//-----------------------------------------------------------------------------
// Bend2D - Physics Engine
// Roberto Bender <beto.bender@gmail.com>
// Description: 
// Date: 15/03/2010
//-----------------------------------------------------------------------------
#ifndef COLLIDABLE_H
#define COLLIDABLE_H

#include "collidableform.h"
#include "moveable.h"
#include <list>

using namespace std;
namespace bend2d
{
    class Collision;
    class Collidable :
        public CollidableForm
    {
    public:
        typedef list<Collidable*> CollidableList;
        CollidableList::iterator& GetCollidableIterator();
        Collidable();
        virtual ~Collidable() {}

        bool CanCollide(Collidable* object);
        void Collide(Collidable* object);
        
        Moveable* m_MoveableCast;
        Point m_CollisionPoint;
    private:
        CollidableList::iterator m_Iterator;
        Collision* m_CollisionHandler;

        bool CanCollideMovingPointWithStaticLine(Collidable* movingPoint, Collidable* staticLine);
        bool CanCollideMovingPointWithMovingPoint(Collidable* movingPointA, Collidable* movingPointB);
    };
}

#endif
